package com.kuaiprint.main;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

public class RegisterActivity extends Activity{

	private TextView register;
	private EditText niCheng;
	private EditText password1;
	private EditText password2;
	private EditText qq;
	private EditText yx;
	private EditText mobile;
	private EditText address;
	private RadioGroup sex;
	private RadioButton male;
	private RadioButton female;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
	
		setContentView(R.layout.user_register);
		initView();
		
	}
	private void initView()
	{
		//注册按钮
		register = (TextView) findViewById(R.id.top_right);
		//昵称
		niCheng = (EditText) findViewById(R.id.user_register_nc);
		
		password1 = (EditText) findViewById(R.id.user_register_password1);
		
		password2 = (EditText) findViewById(R.id.user_register_password2);
		
		qq = (EditText) findViewById(R.id.user_register_qq);
		
		yx = (EditText) findViewById(R.id.user_register_yx);
		
		mobile = (EditText) findViewById(R.id.user_register_mobile);
		
		address = (EditText) findViewById(R.id.user_register_address);
		
		sex = (RadioGroup) findViewById(R.id.user_register_sex);
		
		male = (RadioButton) findViewById(R.id.user_register_male);
		
		female = (RadioButton) findViewById(R.id.user_register_female);
		
		
		
		
		 RadioGroup.OnCheckedChangeListener radiogpchange = new RadioGroup.OnCheckedChangeListener() {
			  @Override
			  public void onCheckedChanged(RadioGroup group, int checkedId) {
			   if (checkedId == male.getId()) {
			    Toast.makeText(getApplicationContext(), "男孩", 1).show();
			   } else if (checkedId == female.getId()) {
			    Toast.makeText(getApplicationContext(), "女孩", 1).show();
			   }
			  }
			 };
			 sex.setOnCheckedChangeListener(radiogpchange);
	}
	
	public void back(View view)
	{
		this.finish();
	}
}
